/****************************************************
          File Name:7-3.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 20 Dec 2014 10:24:18 AM CST
*****************************************************/

#include<iostream>
#include<cstring>
using namespace std;

struct box 
{
    char maker[40];
    float height;
    float width;
    float length;
    float volume;
};

void show_member(char *maker, float height, float width, float length, float volume)
{
    cout << "maker: " << maker
        << "\nheight: " << height
        << "\nwidth: " << width
        << "\nlength: " << length
        << "\nvolume: " << volume << endl;
}

void modify(box *src)
{
    src->volume = src->height * src->width * src->width;
}

int main()
{
    box cube;

    strcpy(cube.maker, "abby cin");
    cube.height = 10.0;
    cube.width = 10.0;
    cube.length = 10.0;

    modify(&cube);
    show_member(cube.maker, cube.height, cube.width, cube.length, cube.volume);

    return 0;
}
